package com.example.active.config;

import lombok.SneakyThrows;
import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Component;

import javax.jms.TextMessage;

/**
 * @author 朝花不迟暮
 * @version 1.0
 * @date 2020/9/18 14:42
 */
@Component
public class TopicConsumerBoot
{
    @SneakyThrows
    @JmsListener(destination = "${myTopic}")
    public void receive(TextMessage textMessage)
    {
        System.out.println("From Topic News ---> "+textMessage.getText());
    }
}
